<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Hello World</title>
  <script src="https://unpkg.com/vue"></script>
</head>

<body>
  <div id="root"></div>
  <script>
    /* 
      1. v-html
      2. v-text
      3. v-bind
      4. v-once
      5. v-on
      6. 动态属性:[]/动态事件@[]
      7. 事件修饰符
        - prevent
    */
    const app = Vue.createApp({
      template: `<div>
        <div v-html="msg"></div>
        <div v-text="msg"></div>
        <div >{{count}}</div>
        <div v-once :[attrName]="msg">{{count}}</div>
        <button @click="handleClick">修改</button>
        <button @[eventName]="handleClick">动态参数</button>
        <a href="https://www.baidu.com" @click.prevent="handleClick">阻止默认行为</a>
      </div>`,
      data() {
        return {
          msg: `<strong>Hello World</strong>`,
          count: 1,
          attrName: 'title',
          eventName: 'click'
        }
      },
      methods: {
        handleClick() {
          this.count++
        }
      }
    })
    const vm = app.mount('#root');
  </script>
</body>

</html>